home *** CD-ROM | disk | FTP | other *** search
/ Ahoy 1988 December / Ahoy_Magazine_88-12_1988_Double_L.d64 / Rapid Random I (.txt) < prev    next >
Commodore BASIC  |  2022-10-26  |  396b  |  13 lines

  1. 0 poke53280,1:print"[147]"tab(12)"rapid randomizer":print"please wait..."
  2. 1 rem ==================================
  3. 2 rem    commodares problem #55-2 :
  4. 3 rem       rapid randomizer
  5. 4 rem    solution by
  6. 5 rem       jim borden
  7. 6 rem ==================================
  8. 10 n=100: dim x(n): for i=1 to n: x(i)=i: next
  9. 20 t0=ti
  10. 30 forx=1ton:i=rnd(1)*n+1:t=x(x):x(x)=x(i):x(i)=t:next
  11. 40 print ti-t0"jiffies"
  12. 50 for i=1 to n:print x(i);:next
  13.